import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


import layout from '@/layout' // index.vue index.js


import home from '@/views/home'
import about from '@/views/about'
import service from '@/views/service'
import caseVue from '@/views/case'
import contact from '@/views/contact'
import applet from '@/views/applet/index.vue'
import app from '@/views/app/index.vue'
import construct from '@/views/construct/index.vue'
import electronicBusiness from '@/views/electronicBusiness/index.vue'

const routes = [
    {
        path: '**',// **代表所有未定义的路由
        name: 'layout',
        component: layout,
        redirect : "/home",//重新跳转路由
        children: [
            {
                path: '/home',
                name: 'home',
                component: home,
            },
            {
                path: '/about',
                name: 'about',
                component: about,
            },
            {
                path: '/service',
                name: 'service',
                component: service,
            },
            {
                path: '/case',
                name: 'case',
                component: caseVue,
            },
            {
                path:'/contact',
                name:'contact',
                component:contact,
            },
            {
                path:'/applet',
                name:'applet',
                component:applet,
            },
            {
                path:'/app',
                name:'app',
                component:app,
            },
            {
                path:'/construct',
                name:'construct',
                component:construct,
            },
            {
                path : '/electronicBusiness',
                name : 'electronicBusiness',
                component : electronicBusiness
            }
        ],
    },
]

const router = new VueRouter({
    routes
})

export default router
